block_worldfandomcom-20200213-history
Blocks
Blocks are the building materials of everything in BlockWorld; from terrain to mobs, everything is made out of blocks. Block behaviour and interractions are the root of every game aspect. Physics The BlockWorld engine performs a reallistic physics simulation on all blocks. To be exact, there is a force-based system that calculates forces, velocities and collisions. All blocks are placed on a square grid, uppon which they move. Each square in the grid can be occupied with at most one solid and one liquid block at a time. Also, blocks that make up the terrain are set to not comply with physics, so as to make gameplay more enjoyable. It is worth mentioning that gravity is generated by special blocks. Liquid blocks spread to all nearby tiles as allowed by forces applied to them (i.e. gravity). Type Each block has a certain type that is used to group them in larger categories. Collision Each block collides with blocks it touches. Uppon collision with another block, possible damage and effects (see bellow) are performed on the other block, as well as physics interactions. Content Each block can have at most another block inside. The latter is reffered to as its content and the former as its parent. The content is usually an item and it affects physics calculations by adding its mass to the block. The content collides with blocks it touches, but it does so seperately to its parent and without performing physics interactions. Finally, blocks have restrictions for which block types are allowed as content. Health and Damage Each block has its own health. If a block's health runs out it is destroyed. Each block's health cannot rise over a specific value. Some blocks (such as terrain borders) have no health and are thus indestructible. There are seven kinds of damage in the game: #slash #bash #heat #cold #poison #heal #necrotic Each block has a multiplier for each of those kinds of damage (multipliers not mentioned in descriptions are considered 1). Whenever something deals an amount of damage to the block, this damage is first multiplied with the appropriate multiplier before being substracted from the block's health. If the multiplier has a negative value, this actually restores block health. Even before performing this multiplication though, any possible defense of the block's content is substracted from the damage. Thus, the resulting formula is the following: (health loss) = (damage type multiplier)*(damage-(content defense to damage type)). If something would deal more than one types of damage, health is lost this way for each of them. Effects Each block can also acquire an effect block. Some blocks are immune to effects though. Like a content, an effect adds its mass to the block. However, it only performs collisions with the block itself. Each effect has a certain health and a duration. Effect's health is continuesly lost according to that duration. Some effects have decreased duration when in liquid. During the game, there may be conflicting effects that target the same block. To resolve the conflict there is a simple engine rules; effects with more health take precedence over effects with less health. That means that effects with much starting health and enough duration will take a while before they allow some weaker effect take their place. For more information on effects visit the Effects entry, which covers all aspects of effects in great detail. Category:Engine